#include <bits/stdc++.h>
using namespace std;

int main()
{
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    int t,n[20010],a[20010][100010],i,j,k;
    cin>>t;
    for(k=0;k<t;k++){
        cin>>n[k];
        for(i=0;i<n[k];i++){
            cin>>a[k][i];
        }
        cout<<3*t;
    }
    return 0;
}
